package org.mspring.mlog.api.spider.service;

import org.mspring.mlog.api.spider.entity.PublishRule;
import org.mspring.platform.dao.hibernate.IGenericDao;

/**
 * 
 * @author Gao Youbo
 * @since 2013年7月22日
 */
public interface PublishRuleService extends IGenericDao<PublishRule, Long> {
    /**
     * 创建
     * 
     * @param rule
     * @return
     */
    public PublishRule createPublishRule(PublishRule rule);

    /**
     * 修改
     * 
     * @param rule
     */
    public boolean updatePublishRule(PublishRule rule);

    /**
     * 删除
     * 
     * @param id
     */
    public boolean deletePublishRule(Long id);

    /**
     * 根据JOB获取PublishRule
     * 
     * @param jobId
     * @return
     */
    public PublishRule getByJob(Long jobId);

    /**
     * 根据RULE统计使用该RULE的发布规则
     * 
     * @param ruleId
     * @return
     */
    public Integer countByRule(Long ruleId);
}
